package com.dlc.shop.systemtest.test.order;

import com.dlc.shop.bean.vo.OrderDetailVO;
import org.testng.Assert;

/**
 * @author lpj
 */
public class AssertOrderDetailVO {

    public static void assertOrderDetailVO(OrderDetailVO orderDetailVO, Double productTotalAmount, Double actualTotal, Double multishopReduce, Double platformShareReduce,
                                    Double distributionAmount, Long useScore, Double rate, Double platformCommission, Double scoreAmount, Double memberAmount,
                                    Double shopMemberDiscountAmount, Double platformCouponAmount, Double shopCouponAmount, Double discountAmount, Double comboAmount,
                                    Double seckillAmount, Double groupAmount, Double shopChangeFreeAmount, Double platformShopChangeAmount, Double refundAmount, Integer refundCount, Double freightAmount) {
        //判断商品金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getProductTotalAmount(), productTotalAmount);

        //判断用户支付金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getActualTotal(), actualTotal);

        //判断商家优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getMultishopReduce(), multishopReduce);

        //判断平台优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getPlatformShareReduce(), platformShareReduce);

        //判断分销金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getDistributionAmount(), distributionAmount);

        //判断使用积分是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getUseScore(), useScore);

        //判断分账比例是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getRate(), rate);

        //判断平台佣金是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getPlatformCommission(), platformCommission);

        //判断积分抵扣金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getScoreAmount(), scoreAmount);

        //判断平台会员抵扣金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getMemberAmount(), memberAmount);

        //判断店铺会员折扣金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getShopMemberDiscountAmount(), shopMemberDiscountAmount);

        //判断平台优惠券抵扣金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getPlatformCouponAmount(), platformCouponAmount);

        //判断店铺优惠券抵扣金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getShopCouponAmount(), shopCouponAmount);

        //判断满减优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getDiscountAmount(), discountAmount);

        //判断套餐优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getComboAmount(), comboAmount);

        //判断秒杀优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getSeckillAmount(), seckillAmount);

        //判断拼团优惠金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getGroupAmount(), groupAmount);

        //判断店铺改价金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getShopChangeFreeAmount(), shopChangeFreeAmount);

        //判断平台优惠减少金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getPlatformShopChangeAmount(), platformShopChangeAmount);

        //判断退款金额是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getRefundAmount(), refundAmount);

        //判断退款数量是否正确
        Assert.assertEquals(orderDetailVO.getOrderItemDetailList().get(0).getRefundCount(), refundCount);

        //判断运费是否正确
        Assert.assertEquals(orderDetailVO.getFreightAmount(), freightAmount);

    }

    @Override
    public String toString() {
        return "AssertOrderDetailVO{}";
    }
}
